package com.jf.cloud.user.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.user.dto.UserTravelsCommentDTO;
import com.jf.cloud.user.model.UserTravelsComment;
import com.jf.cloud.user.mapper.UserTravelsCommentMapper;
import com.jf.cloud.user.service.UserTravelsCommentService;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 
 *
 * @author zz
 * @date 2023-11-10 16:10:35
 */
@Service
public class UserTravelsCommentServiceImpl implements UserTravelsCommentService {

    @Autowired
    private UserTravelsCommentMapper userTravelsCommentMapper;

    @Override
    public PageVO<UserTravelsComment> page(PageDTO pageDTO, UserTravelsCommentDTO userTravelsCommentDTO) {

        return PageUtil.doPage(pageDTO, () -> userTravelsCommentMapper.list(userTravelsCommentDTO));
    }

    @Override
    public UserTravelsComment getById(Long id) {
        return userTravelsCommentMapper.getById(id);
    }

    @Override
    public void save(UserTravelsComment userTravelsComment) {
        userTravelsCommentMapper.save(userTravelsComment);
    }

    @Override
    public void update(UserTravelsComment userTravelsComment) {
        userTravelsCommentMapper.update(userTravelsComment);
    }

    @Override
    public void deleteById(Long id) {
        userTravelsCommentMapper.deleteById(id);
    }
}
